<?php
class Application_Form_Login extends Zend_Form
{
	public function init()
	{
		$this->setMethod(self::METHOD_POST);
		$this->setAction('/account/login');
		//add form elements
		//TODO add more validations
		$this->addElement('text', 'email', array(
            'label'      => 'Email:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                'EmailAddress',
            )
        ));
        $this->addElement('password', 'password', array(
            'label'      => 'Password:',
            'required'   => true,
            'validators' => array(
                array('validator' => 'StringLength', 'options' => array(0, 20))
                )
        ));
        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Login',
        ));
        $this->addElement('hash', 'csrf', array(
            'ignore' => true,
        ));
	}
}